package com.iwhalecloud.bss.kite.cucc.service.attr.handler;

import com.iwhalecloud.bss.kite.common.util.KiteStringUtils;
import com.iwhalecloud.bss.kite.cucc.common.constant.LocalKeyConsts;
import com.iwhalecloud.bss.kite.cucc.common.constant.LocalServiceOfferConsts;
import com.iwhalecloud.bss.kite.manager.api.IQuerySceneInstService;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.manager.inst.KiteSceneInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import com.iwhalecloud.bss.kite.service.attr.handler.AbstractAttrHandler;
import com.ztesoft.bss.common.util.SpringUtil;

public class IsIDCOutWordsAttrHandler extends AbstractAttrHandler<KiteInst, AttrData> {
    @Override
    public void after(KiteAttr attr, KiteInst inst, AttrData data) {
        IQuerySceneInstService querySceneInstService = SpringUtil.getBean(IQuerySceneInstService.class);
        KiteSceneInst sceneInst = querySceneInstService.getSceneInst(data.getSceneInstId());
        String provinceCode = sceneInst.getProvinceNbr();
        String serviceOfferId = data.getServiceOfferId();
        if (LocalKeyConsts.PROVINCE_GUANGDONG.equals(provinceCode)) {
            if (KiteStringUtils.equalsAny(serviceOfferId,"1", LocalServiceOfferConsts.SERVICE_OFFER_RESOURCE_CHECK)) {
                if ("200001832".equals(attr.getFieldName())) {
                    this.set(attr, inst, "1_0000107", data);
                }
            }
        }
        super.after(attr, inst, data);
    }
}
